?><?
class cls_file_lib extends cls_entity{

  function entity(){return "file_lib";}
  function item($id){return parent::get_db_item(cls_file_lib::entity(),$id);}
  function by_entity($entity,$id){return parent::get_db_items(cls_file_lib::entity(),array(array(otEMP,"entity_name",otEQ,$entity),array(otAND,"entity_id",otEQ,$id)));}

  function get($object,$page=0){return parent::get_db_items(cls_file_lib::entity(),array(array(otEMP,"entity_name",otEQ,$object->entity()),array(otAND,"entity_id",otEQ,$object->id)));}

  function insert($object,$data){$data["entity_id"]=$object->id();$data["entity_name"]=$object->entity();return parent::insert(cls_file_lib::entity(),$data);}

}
